#!/bin/bash

# echo "start .bashrc"
echo -e "${HLIGHT}---$HOME/.bashrc---${NORMAL}" #start files

IIFS=$IFS

export IIFS

. "$HOME/.os/git-prompt.sh"

export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='\u@\H \w$(__git_ps1 " (%s)")\$ '

if [ -f ~/.bash_aliases ]; then

    . ~/.bash_aliases

fi

c_up() {
    echo -e "${CYAN}---c_up() \$1 = $1---${NORMAL}" #started functions
    IFS=$IIFS

    cd_h "$1" "$filename" "$LINENO"

    local dir
    dir=$(pwd)

    for item in *; do
        # echo -e "${GREEN}\$item = $item${NORMAL}"             #print variable
        # echo -e "${GREEN}\${item:0:1} = ${item:0:1}${NORMAL}" #print variable
        local item_path=$dir/$item
        if [ -f "$item_path" ] && [ "${item:0:1}" != "_" ]; then
            . "$item_path"
            elif [ -d "$item_path" ] && [ "${item:0:1}" != "_" ]; then

            c_up "$item_path"

        fi

    done
}

export c_up

# ladd() {
#     dir= $(ls "$1")
#     echo "$dir"
# }

# up_sis() {

#     echo -e "${CYAN}---up_sis()---${NORMAL}" #started functions

#     . "$HOME/.os/.bashrc_orig"
#     # . "$HOME/.os/git-prompt.sh"
#     . "$HOME/.os/git-alias.bash"
#     . "$HOME/.os/git-completion.bash"

#     . "$HOME/.qa/gremium/unus.sh"
#     . "$HOME/.qa/lib/1_ini.sh"
#     . "$HOME/.qa/lib/0_ini.sh"


# }

# export up_sis

# up_lib_git() {

#     echo -e "${CYAN}---up_lib_git()---${NORMAL}" #started functions

#     . "$HOME/.qa/sis_git/up_git_memory.sh"
#     . "$HOME/.qa/sis_git/git_utils.sh"
#     . "$HOME/.qa/sis_git/cl_git.sh"
#     . "$HOME/.qa/sis_git/git_enter.sh"
#     . "$HOME/.qa/sis_git/bck_git.sh"
#     . "$HOME/.qa/sis_git/git_comands_lib.sh"
#     . "$HOME/.qa/sis_git/git_add_repo_after.sh"
# }

# export up_lib_git

rr() {
    echo -e "${CYAN}---rr()---${NORMAL}" #started functions

    echo -e "${ULINE}. "$HOME/.bashrc"${NORMAL}" #repit commands
    . "$HOME/.bashrc"
}

# export q_init

# start libs
# up_sis
# up_lib_git

# info

c_up "$HOME/.qa/"
c_up "$HOME/.os/"

upgit
e_git

###
##
